﻿@using FwProject.Com.Dto
@using FwProject.ShoppingMall.Com
@model List<ShopOrderDetailsDto>
@{
}
<style>
    .layui-table tr th, .layui-table tr td {
        text-align: center;
        padding: 9px 15px !important
    }
</style>
<form id="form0" class="layui-form layui-form-pane" action="/Settlement/Examine?id=@ViewBag.Id" method="get" novalidate="novalidate" data-ajax="true" data-ajax-success="ReloadAjaxCallbackgoback" data-ajax-failure="FailureAjaxCallback" data-ajax-method="Get" role="form" lay-filter="form1" style="margin-bottom: 80px;">
    <div class="layui-form" style="padding:10px;">
        <table class="layui-table">
            <thead>
                <tr>
                    <th>订单号</th>
                    <th>下单时间</th>
                    <th>商品名称</th>
                    <th>商品规格</th>
                    <th>购买数量</th>
                    <th>单价</th>
                    <th>支付金额</th>
                </tr>
            </thead>
            <tbody>
                @foreach (var item in Model)
                {
                    <tr>
                        <td>@item.OrderNumber</td>
                        <td>@item.CreationTime.ToString("yyyy-MM-dd HH:mm")</td>
                        <td>@item.ShopName</td>
                        <td>@item.SkuName</td>
                        <td>@item.ProductCount</td>
                        <td>@item.PayPrice.ToString("C")</td>
                        <td>@item.PayAmountPrice.ToString("C")</td>
                    </tr>
                }
            </tbody>
        </table>
    </div>
    @if (ViewBag.ExamineStatus == ExamineStatus.未审核)
    {
        <div class="layui-layer-btn layui-layer-btn-" style="padding:8px 12px;z-index:1000;position: fixed;bottom:0;left: 1px;width: 98%;height: 50px; background:rgba(230,230,230,0.8)">
            <a id="examine" class="layui-layer-btn0" lay-submit="" lay-filter="saveprops">确认审核</a>
        </div>
    }
</form>
@section scripts{
    <script type="text/javascript">
        var form, layer, layedit;
        layui.use(['form', 'layedit', 'layer'], function () {
            layedit = layui.layedit;
            form = layui.form;
            layer = layui.layer;
        });


        $('#examine').on('click', function () {
            $('#form0').submit();
        });
        function ReloadAjaxCallbackgoback(data, successInfo) {
            if (data.success) {
                parent.layer.msg('审核成功！')
                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                parent.layer.close(index); //再执行关闭当前iframe页面
            } else {
                layer.msg('保存失败：' + successInfo);
            }
        }

    </script>
}
